import { createRouter, createWebHistory } from 'vue-router'
const routes = [
  { path: '/', redirect: '/index' },
  {
    path: '/index',
    component: () => import('../view/index/Index.vue'),
    meta: {
      isHasTab: true,
      keepAlive: true
    }
  },
  {
    path: '/setbase',
    component: () => import('../view/base/addBase.vue'),
    meta: {
      isHasTab: false,
      keepAlive: false
    }
  },
  {
    path: '/baselist',
    component: () => import('../view/base/baseList.vue'),
    meta: {
      isHasTab: false,
      keepAlive: true
    }
  },
  {
    path: '/baseDetail/:id', //基地详情
    component: () => import('../view/base/detail.vue'),
    meta: {
      isHasTab: false,
      keepAlive: false
    }
  },
  {
    path: '/baseAppointment/:id', //基地预约
    component: () => import('../view/base/baseAppointment.vue'),
    meta: {
      isHasTab: false,
      keepAlive: false
    }
  },
  {
    path: '/basePremise/:id', //基地协议
    component: () => import('../view/base/basePremise.vue'),
    meta: {
      isHasTab: false,
      keepAlive: false
    }
  },
  {
    path: '/activity',
    component: () => import('../view/activity/index.vue')
  },
  {
    path: '/activityDetail/:id',
    component: () => import('../view/activity/detail.vue')
  },
  {
    path: '/resource',
    component: () => import('../view/resource/index.vue')
  },
  {
    path: '/resourceDetail/:id',
    component: () => import('../view/resource/detail.vue')
  },
  {
    path: '/expert',
    component: () => import('../view/expert/index.vue')
  },
  {
    path: '/addExpert',
    component: () => import('../view/expert/addExpert.vue')
  },
  {
    path: '/expertDetail/:id',
    component: () => import('../view/expert/detail.vue')
  },
  {
    path: '/course',
    component: () => import('../view/course/index.vue')
  },
  {
    path: '/courseDetail/:id',
    component: () => import('../view/course/detail.vue')
  },
  {
    path: '/expertOrder/:id',
    component: () => import('../view/expert/order.vue')
  },
  {
    path: '/courseOrder/:id',
    component: () => import('../view/course/order.vue')
  },
  {
    path: '/user',
    component: () => import('../view/user/index.vue'),
    meta: {
      isHasTab: true,
      keepAlive: true
    }
  },
  {
    path: '/user/orderRecord',
    component: () => import('../view/user/orderRecord.vue')
  },
  {
    path: '/user/myBaseInfo/:id',
    component: () => import('../view/user/myBaseInfo.vue')
  },
  {
    path: '/user/applyRecord',
    component: () => import('../view/user/applyRecord.vue')
  },
  {
    path: '/user/applyBaseRecord',
    component: () => import('../view/user/applyBaseRecord.vue')
  },
  {
    path: '/user/activityRecord',
    component: () => import('../view/user/activityRecord.vue')
  }
]

export default createRouter({
  history: createWebHistory(),
  routes: routes
})
